package com.ml.mall.model.mail.general;

import com.ml.mall.model.MailMessage;
import org.springframework.stereotype.Component;

/**
 * @description 该类提供了公共类的邮件模板
 * @author pl
 * @date 2021/7/13
 * @version 1.0
*/
@Component
public class MailTemplateGeneral {



    /**
     * 重置密码，系统发送 “重置密码” 邮件给买家
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getResetPassword(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Password reset.");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                Password Reset\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi <strong>user_name,</strong></p>\n" +
                "        <br>\n" +
                "        <p>You have requested to reset your password.</p>\n" +
                "        <p>Below is the generated code:</p>\n" +
                "        <span style=\"font-size: 25pt; font-weight: bold; font-family: 'Courier New', monospace;\">[ generated_code ]</span>\n" +
                "        <br>\n" +
                "        <p>Need help? Contact <strong>contact_no</strong> or send email to <strong> general_email </strong> for system enquiry.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure System</strong></p>\n" +
                "        \n" +
                "    </div>\n" +
                "</div>");

        return mailMessage;
    }
}
